<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

include '../../../../readcookie.php';
include '../../../../db.php';
$id=$_POST['id'];
$title=$_POST['title'];

$publish=$_POST['publish'];
if($publish==NULL){ $publish='false'; }else{ $publish='true'; }


//echo $publish;
$content=mysql_real_escape_string($_POST['content']);
$subtitle=mysql_real_escape_string($_POST['subtitle']);
$header=mysql_real_escape_string($_POST['header']);
$footer=mysql_real_escape_string($_POST['footer']);

if($subtitle==''){ $isubtitle='false'; }else{ $isubtitle='true'; }
if($header==''){ $iheader='false'; }else{ $iheader='true'; }
if($footer==''){ $ifooter='false'; }else{ $ifooter='true'; }

$query="UPDATE Article SET
articlePUBLISH = '$publish',
articleTITLE = '$title',
articleCONTENT = '$content',
includeSUBTITLE = '$isubtitle',
articleSUBTITLE = '$subtitle',
includeHEADER = '$iheader',
includeFOOTER = '$ifooter',
articleFOOTER = '$footer',
articleHEADER = '$header'

WHERE
articleID = '$id'";

mysql_query($query) or die('Error, insert query failed');
echo '
<script type="text/javascript">
window.location.href = document.referrer;
</script>
';

?>